package org.smart4j.framework.bean;

import org.smart4j.framework.utils.CastUtil;

import java.util.Map;

/**
 * 请求参数对象
 * @Description:
 * @Author: Administrator
 * @Date: 2017/8/15 0015 下午 9:46
 */
public class Param {

    private Map<String ,Object> paramMap;

    public Param() {
    }

    public Param(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    public long getLong(String name) {
        return CastUtil.castLong(paramMap.get(name));
    }

    public String getString(String name) {
        return CastUtil.castString(paramMap.get(name));
    }

    public boolean getBoolean(String name) {
        return CastUtil.castBoolean(name);
    }

    public double getDouble(String name) {
        return CastUtil.castDouble(paramMap.get(name));
    }

    public float getFloat(String name) {
        return CastUtil.castFloat(paramMap.get(name));
    }

    public int getInt(String name) {
        return CastUtil.castInt(name);
    }

    public Map<String, Object> getParamMap() {
        return paramMap;
    }
}
